﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tracy.DataModel;
using SharedLib.MessageFramework;
using SharedLib.MessageFramework.Messages;

namespace Tracy.Messages
{
    public class GetXmlFromFeedSourceMessage : GetXmlFromURLMessage
    {
        private FeedSource _source;

        public FeedSource Source
        {
            get { return _source; }
            set { _source = value; }
        }

        private Entry _entry;

        public Entry Entry
        {
            get { return _entry; }
            set { _entry = value; }
        }

        public GetXmlFromFeedSourceMessage(object sender, FeedSource source, Entry entry, IAppMessage parentMessage = null)
            : base(sender, new MessageData<string>(source.GenerateUrl(entry)), parentMessage)
        {
            _source = source;
            _entry = entry;
        }

        public override Type Handler
        {
            get { return typeof(Tracy.Handlers.GetXmlFromURLHandler); }
        }

        public override string HandlerUID
        {
            get
            {
                return base.HandlerUID + "_UI";
            }
        }
    }
}
